// 书写商品相关的所有 api 接口
import request from '@/utils/requiest'

interface MyHotListParams {
    count?: number,
    limitNum?: number
}


// 1.秒杀商品接口
export const hotListApi = (info: MyHotListParams) => request.get('/pro/seckilllist', {
    params: info
})

// 2. 热门搜索的接口
export const hotSearchApi = () => request.get('pro/hotword')

//3.模糊搜索的接口
export const searchListApi = (keyword: string) => request.get('/pro/search' ,{
    params: { keyword }
})

//4.获取商品列表
export const goodsListApi = (info: { count: number, limitNum?: number }) => request.get('/pro/list', {
    params: info
})

//5.产品分类列表
export const categoryListApi = () => request.get('/pro/categorylist')

//6.产品分类下的品牌列表
export const cateBrandListApi = (cate: string) => request.get('/pro/categorybrandlist', {

    params: { category: cate }
})

//7.产品分类+品牌的接口
export const categortBrandGoodsListApi = (info: { category: string, brand: string }) => request.get('/pro/categorybrandprolist', {
    params: info
})

// 8. 请求商品详细信息
export const getGoodsDetailApi = (id: string) => request.get(`/pro/detail/${ id }`)











